package com.atguigu.rabbit.consumer.listener.pubsub;

import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.nio.charset.StandardCharsets;

/**
 * @Author: Worker Hu
 * @CreateTime: 2024-07-23  16:17
 */
@Component
public class PubsubQueue01 {

    @RabbitListener(queues = "pubsub_queue01")
    public void comsume01(Message message){
        System.out.println("PubsubQueue01消费了: " + new String(message.getBody(), StandardCharsets.UTF_8));
    }
}


